const ips = ['172.16.13.146']
const host = ips[0]

const os = require('os')

let needHost = '';
try {
  let network = os.networkInterfaces();

  for (let dev in network) {
    let iface = network[dev];
    for (let i = 0; i < iface.length; i++) {
      let alias = iface[i];
      if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal) {
        needHost = alias.address;

      }
    }
  }
} catch (e) {
  needHost = 'localhost';
}

module.exports = {
  WebPort: 8083,
  WebHost: needHost, //本地域名
  WSHost: `ws://${host}`,
  ServerHost: `http://${host}/`, //要访问的接口域名
  Serverip: host, //本地域名
  Host: host,
}